<div class="breadcrum">
    <p>
        <a href="{$config->site_url('master/overview')}">Master</a><span></span><small>Jenis Barang</small>
    </p>
    <div class="clear"></div>
</div>
<div class="search-box">
    <h3><a href="#">Search</a></h3>
    <form method="post" action="{$config->site_url('master/jenisbarang/proses_cari')}">
        <table width="100%" border="0" class="table-search">
            <tbody>
                <tr>
                    <th align="left" width="15%">Jenis</th>
                    <td align="left" width="15%">
                        <input type="text" style="width: 190px;" maxlength="50" size="30" value="{$search.jenisbarang_name|default:''}" name="jenisbarang_name"> 
                    </td>       
                    <th width="15%">Kategori Barang</th>
                    <td width="35%">
                        <select style="width: 200px;" name="kategoribarang_cd" id="kategoribarang_cd">
                            <option value=""></option>
                            {foreach from=$rs_kategoribarang item=data}
                            <option value="{$data.kategoribarang_cd|default:''}" {if {$search.kategoribarang_cd|default:''} eq $data.kategoribarang_cd}selected="selected"{/if}>{$data.kategoribarang_name}</option>
                            {/foreach}
                        </select>

                        <input type="submit" value="Tampilkan" name="save" class="submit">
                        <input type="submit" value="Reset" name="save" class="submit">   
                    </td>
                    <td align="left" width="20%"></td>
                </tr>

            </tbody>
        </table>
    </form>
</div>
<div class="sub-content">
    <div class="navigation"> 
        <div class="pageRow">
            <div class="pageNav">
                <ul>
                    <li class="info"><strong>{$pagination.start|default:'0'} - {$pagination.end|default:'0'}</strong> dari <strong>{$pagination.total|default:'0'}</strong> Data</li>
                    {$pagination.data|default:''}
                </ul>
            </div>
            <div class="clear"></div>
        </div>
        <div class="navigation-button">
            <ul>
                <li><a href="{$config->site_url('master/jenisbarang/add')}"><img alt="" src="{$BASEURL}/resource/doc/images/icon/add-icon.png">Tambah Data</a></li>
                <!--                <li><a href="{$config->site_url('master/jenisbarang/print')}"><img alt="" src="{$BASEURL}/resource/doc/images/icon/printer-icon.png">Print out</a></li> -->
            </ul>
            <div class="clear"></div>
        </div>
    </div> 
    <!-- notification template -->
    {include file="base/templates/notification.html"}
    <!-- end of notification template--> 
    <table width="100%" class="table-view">
        <tbody>
            <tr>
                <th width="23%">Kategori Barang</th> 
                <th width="10%">Kode</th>
                <th width="55%">Jenis Barang</th>  
                <th width="12%"></th>
            </tr>

            {assign var="kategoribarang_cd_tmp" value=""}
            {assign var="kategoribarang_name_tmp" value=""}

            {foreach from=$rs_id key=no item=result}

            {if $kategoribarang_cd_tmp|default:'' neq {$result.kategoribarang_cd}}
            {assign var="kategoribarang_name_tmp" value=$result.kategoribarang_name} 
            {assign var="kategoribarang_cd_tmp" value=$result.kategoribarang_cd}
            {else}
            {assign var="kategoribarang_name_tmp" value=""}
            {/if}

            <tr {if ($no % 2) <> 0}class="blink-row"{/if}>
                <td><b>{$kategoribarang_name_tmp}</b></td> 
                <td align="center">{$result.jenisbarang_cd}</td>
                <td>{$result.jenisbarang_name}</td>  
                <td align="center">
                    <a href="{$config->site_url({'master/jenisbarang/edit/'|cat:$result.jenisbarang_cd})}/{$result.kategoribarang_cd}" class="button-edit">Edit</a>
                    <a href="{$config->site_url({'master/jenisbarang/delete/'|cat:$result.jenisbarang_cd})}/{$result.kategoribarang_cd}" class="button-hapus">Hapus</a>
                </td>
            </tr>
            {foreachelse}
            <tr>
                <td colspan="4">Data masih kosong</td>
            </tr>
            {/foreach}
        </tbody>
    </table> 
</div>